iT邦幫忙

2023 iThome 鐵人賽

DAY 7
0
IT管理

每天利用 Jira 開單時,練習一個密技,應該不是薪水小偷吧!?系列 第 7

Day7-又是樸實無華的 Jira 開單日常- 任務到期前1天自動寄催債信

  • 分享至 

  • xImage
  •  

到了第七天了,「又是樸實無華的 Jira 開單日常」系列,今日連載第二期,希望大家看完會有收獲。

在分享今天的功課前,我在 Day5-你不是不好只是太用腦,快啟用 Jira Transitioned Automation template -2,啟用 Transitioned Automation template - When an issue remains for 5 days without an update → send a notification to the Assignee ,已經奏效啦!!有圖有真相啦!
https://ithelp.ithome.com.tw/upload/images/20230922/201626734kHq9neBXX.png

我在開賽第一天時有開了一張 ticket II3D-2 - 實作同事分享的 Automation 密技 放在 backlog,因為這張票是提醒自己準備下階段( Day 11-20 之間)鐵人賽的文章,所以這幾天都沒有去更新它的狀態,雖然這項提醒是在 Day5,以設定的時間點至今天 day7 還未五天,看起來自動化的設定是可以回溯至設定前,若有條件符合都能抓到的。


今日分享

  1. Keywords
  2. 啟用 When a task is near due → send email reminder

照慣例,在練習前我們要怎麼樣? 對,先認識 Keywords

Keywords:smart values

我們在前幾天的 Automation 設定中,如果有留意 JQL 或 信件中的設定值,應該有看到 {{issue.key}}{{issue.summary}}{{issue.assignee.displayName}} 等設定值,這就是 smart value,它可以讓你可以在 Atlassian Cloud 中訪問和操作問題數據,為您的定下的設定增加顯著的功能和複雜性。例如:
{{issue.key}} 是指 issue key 的變數。
{{issue.summary}} 是指列出問題的摘要。
{{issue.assignee.displayName}} 是指該 issue 的負責人,在系統上顯示的名字。
{{now.plusDays(5)}} 現在的時間為基準並在其上增加了5天
{{page.created}} 列出 Confluence 頁面的創建日期和時間
以上類推~~~
想了解更多可詳閱 What are smart values?Jira smart values - issues


啟用 When a task is near due → send email reminder

今日分享主題:當一個 issue 開出來後,小日子過的特別快,一下子就接近到期日,但如果你的開發爆炸是日常,就很容易沒有發現死線到了,因此,在接近到期日前,Jira 小秘書默默的寄了封催債信給你,一封催技術債的信,這樣你會知道死線到了,死線到了、死線到了(很重要所以講三次)。

因此,今天我們要來練習: When a task is near due → send email reminder Automation template 的設定喔。


  1. 首先從專案 Board 點擊左邊功能區的 [Project setting]。https://ithelp.ithome.com.tw/upload/images/20230920/20162673rks8sgd5Q9.png

  2. 點擊左邊功能區的 [Automation]。https://ithelp.ithome.com.tw/upload/images/20230920/20162673aHW1eeJHiE.png

  3. 點擊中間上方的 [Rules] 、[Audit log] 、 [Templates] 的 [Templates]。
    https://ithelp.ithome.com.tw/upload/images/20230920/20162673xgW5g4X7RJ.png

  4. 進到 Automation templates 選單後向下拉。https://ithelp.ithome.com.tw/upload/images/20230920/201626734TQRmk2H5y.png

  5. 找到 When a task is near due → send email reminder ,並點擊進去。https://ithelp.ithome.com.tw/upload/images/20230923/20162673p4AQwJgM5r.png

  6. Rules details 已經自動的填完 [Name][Description]
    [Name]:When a task is near due → send email reminder

[Description] :Never miss a deadline with email reminders. When a task is near due, this rule will automatically send email notification to the assignee.
https://ithelp.ithome.com.tw/upload/images/20230923/20162673KYAtvOKsTC.png

  1. 詳看 [When] 的設定
    (1)我們也點擊 [When] 了解一下 Automation rules 的設定。
    When:Scheduled
    Every day at 8:00 AM

在此意指每天早上 8:00 會進行全環境掃描。

(2)時間設定分為 Basic 和 Advanced (CRON expression)
關於 Basic 和 Advanced (CRON expression)我在Day5-你不是不好只是太用腦,快啟用 Jira Transitioned Automation template -2 有較詳細解說,今天我就不多說明。

https://ithelp.ithome.com.tw/upload/images/20230923/201626735AhN62rcZF.png

  1. 詳看 [Than] 的設定
    (1)我們也點擊 [than] 了解一下 Automation rules 的設定。
    Then:Create variable
    Create smart value variable
    {{numberOfDaysBeforeDueInclusion}}

(2)在**「Create variable]** 設定中,其 [Variable name] 為 numberOfDaysBeforeDueInclusion,原始設定 [Smart value] 是 3。
https://ithelp.ithome.com.tw/upload/images/20230923/20162673yBDOGFY0uc.png
但因為此專案的 ticket 的 due date 都只有設定 1 天,因此,我把 [Smart value] 手動改成 「1」,再按 [Save]。
https://ithelp.ithome.com.tw/upload/images/20230923/20162673MVeShCVD4M.png

  1. 詳看 [And] 的設定
    (1)And:Lookup issue
    Search for issue using JQL
    duedate <= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee != empty

(2)上述的 JQL 意思為
當到期日小於=1天內的結束日 而且 此ticket 不在 status [Done] 而且 負責人不是空白的 。 AND以上條件必須是全部符合。
https://ithelp.ithome.com.tw/upload/images/20230923/20162673q2zMHLByUc.png

  1. 詳看 [For each] 的設定
    (1)For each:Smart value
    {{distinctAssignee}}

(2)[Advanced branching] 進階其他設定
[Smart value]

{{lookupIssues.assignee.distinct}} 這裡可能指其他有在關注 Issue 特定負責人

[Variable name]

distinctAssignee

https://ithelp.ithome.com.tw/upload/images/20230923/20162673gFlasxic4Q.png

  1. 詳看 [Than] 的設定
    (1)和 (2)Than:Lookup issue
    duedate <= endOfDay({{numberOfDaysBeforeDueInclusion}}) AND statusCategory != done AND assignee = {{distinctAssignee}}
    此處的 JQL 新增上面 For each 的進階設定。

https://ithelp.ithome.com.tw/upload/images/20230923/20162673odFfkcVZZ1.png

  1. 詳看 [And] 的設定
    (1)And:Send email
    {{distinctAssignee.emailAddress}}
    Issues Due Within 1 Days
    (2)email 內容設定
    [Subject]

Issues Due Within 1 Days

[Content]

Hello {{distinctAssignee.displayName}},

The following issues are due within next 3 days:
{{#lookupIssues}}
{{key}} - {{summary}}
{{/}}

Regards,

Jira Automation

https://ithelp.ithome.com.tw/upload/images/20230923/20162673pbtFttJ27n.png

(3)最後再按下右上角的 [Turn it on],恭喜完成 ✅ ,灑花~

  1. 回到 Rules list ,這個 Rule 已經設定完成。
    https://ithelp.ithome.com.tw/upload/images/20230923/20162673ImXhBKaEQo.png

  2. 我們也點擊看 [Audit log] 這次的設定,因為我有把原定為 3 的 smart value 調整成 1 ,而這個調整被納入紀錄中
    https://ithelp.ithome.com.tw/upload/images/20230923/20162673kjghxls7oN.png

哈哈!本日完成練習!大家晚安。


上一篇
Day6-又是樸實無華的開單日常-你卡一個 Bug ,Jira 自動抓交替來幫你看!
下一篇
Day8-又是樸實無華的 Jira 開單日常- 小心!更新到關鍵字就會被貼標籤
系列文
每天利用 Jira 開單時,練習一個密技,應該不是薪水小偷吧!?30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言